GamepadButtons Class
Controls gamepad button input
Constructor
GamepadButtons
()
Methods
emit
-
type -
data
Emits an event which will run all registered listeners for the event type
Parameters:
-
typeStringThe event name to emit
-
dataMixedAny data you want passed along with the event
Returns:
Returns itself.
off
-
type -
listener
Removes a listener function for an event type
Parameters:
-
typeStringThe event name to emit
-
listenerFunctionThe function to remove
Returns:
Returns itself.
on
-
type -
listener
Registers a listener function to be run on an event occurance
Parameters:
-
typeStringThe event name to listen for
-
listenerFunctionThe function to execute when the event happens
Returns:
Returns itself.
once
-
type -
listener
Registers a one-time callback for an event
Parameters:
-
typeStringThe event name to listen for
-
listenerFunctionthe callback to call when the event occurs
Returns:
Returns itself.
pollStatus
-
pad
Polls the gamepad object for status updates and emits events when they occur
Parameters:
-
padGamepadThe gamepad object to check
Properties
BUTTON
Object
static
Bindable Gamepad Buttons
threshold
Number
The threshold at which we consider a button "pressed"
Default: 0.4